module.exports = async (ctx, next) => {
      ctx.error = ({ data, msg, status, error, code }) => {
        code = code || -200
        ctx.status = status || 200;
        ctx.body = { code, msg, data, error };
      }
      ctx.success = ({ data, msg }) => {
        ctx.body = { code: 200, msg, data };
      }
    await next()
  }